<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="startRandomCall()">开始点名</button>
    <p id="result"></p >
</body>
<script>
    /*
    function getRandomIntInclusive(min, max) {
        const minCeiled = Math.ceil(min);
        const maxFloored = Math.floor(max);
        return Math.floor(Math.random() * (maxFloored - minCeiled + 1) + minCeiled); // 包含最小值和最大值
    }
    console.log(Math.floor(Math.random()*(60-1+1)+1));
    */
   let arr = ['cc','xx','ff','jj','kj','fd'];
   let array = new Array('s','h','k','y','o','p');
   let RanIndex = Math.floor(Math.random() * (arr.length));
   console.log(arr[RanIndex]);
   //随机点名，点过的名字不重复点，如果全部点完名推出点名并提示用户

    const names = ['张三', '李四', '王五', '赵六', '孙七', '周八'];
    let calledNames = [];
    function startRandomCall() {
      if (names.length === calledNames.length) {
        document.getElementById('result').textContent = '所有名字都已点过。';
        return;
      }

      let randomIndex;
      do {
        randomIndex = Math.floor(Math.random() * names.length);
      } while (calledNames.includes(names[randomIndex]));

      const calledName = names[randomIndex];
      calledNames.push(calledName);
      document.getElementById('result').textContent = calledName + '被点名了！';
    }
    
    //猜数字，猜中交作业
    let num;
    function cai(min,max){
        return Math.floor(Math.random()*(max-min)+1);
    }
    let boom = cai(1,10);
    while(true){
        num = prompt('请输入你猜的数字');
        if(num == boom){
          alert('恭喜喜提作业');
          break;
        }else if(num > boom){
            alert('你猜大了');
        }else{
          alert('你猜小了');
        }
    }
</script>
</html>